#include <stdio.h>

enum bool {
        false, true
};
typedef enum bool Bool;

Bool huiwen(int n)
{
        int tmp1 = n;
        int tmp2 = 0;
        while (n)
        {
                tmp2 = tmp2 * 10 + n % 10;
                n /= 10;
        }
        if (tmp2 == tmp1)
                return true;
        else
                return false;
}

int main()
{
        int n;
        int count = 0;
        while (1)
        {
                scanf("%d", &n);
                if (n == -1)
                        break;
                if (huiwen(n))
                        count++;
        }
        printf("%d\n", count);
        return 0;
}